<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后代选择器</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
        }

        main {
            padding: 2rem;
            width: 1200px;
            background-color: #EEEEEE;
        }

        main div {
            margin-left: 1rem;
        }

        main div h2,
        main h1 {
            color: red;
        }
    </style>
</head>

<body>
    <main>
        <h1>后代选择器</h1>
        <p>后代选择器（Descendant Selector）：选择器可以选择作为某元素后代的元素。语法为单个空格（" "）字符组合两个选择器</p>
        <div>
            <h3 name="houdunren">后盾人编程</h3>
            <h2>div元素中的子级元素h2</h2>
            <aside>
                <h2>aside元素中的孙级元素h2</h2>
            </aside>
            <h1>孙级元素</h1>
        </div>
        <h2 name="hdcms.com">hdcms.com</h2>
        <h1>子级元素</h1>
    </main>
</body>

</html>